/*
 * @Author: 曹捷
 * @Date: 2020-06-13 10:54:38
 * @LastEditors: 曹捷
 * @LastEditTime: 2020-06-13 11:14:45
 * @Description: file content
 */
export default {
    methods: {
        // 上传图片
        uploadImg() {
            uni.chooseImage({
                success: chooseImageRes => {
                    const tempFilePaths = chooseImageRes.tempFilePaths
                    console.log('uploadImg -> tempFilePaths', tempFilePaths)
                    uni.uploadFile({
                        url: 'https://www.example.com/upload', //仅为示例，非真实的接口地址
                        filePath: tempFilePaths[0],
                        name: 'file',
                        formData: {
                            user: 'test'
                        },
                        success: uploadFileRes => {
                            this.imgSuccess(uploadFileRes)
                        }
                    })
                }
            })
        },
        imgSuccess() {

        }
    }
}